<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	
	SQLTitle = "-- ■■■■ 메모 정보 List ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 
	
	accessId = Request.Cookies("S_uid")

	SQL = "SELECT A.memoSeq, B.userNm, A.memo, CONVERT(varchar(16), A.addDt, 121) addDt  FROM tblMemo A LEFT JOIN tblUser B ON A.toUserId=B.userId WHERE A.flag='Y' AND A.confirmDt IS NULL AND A.toUserId='" & accessId & "' ORDER BY A.addDt DESC" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<Memo>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			if memoSeqs <> "" then memoSeqs = memoSeqs & ","
			memoSeqs = memoSeqs & rs("memoSeq") 
			
			addDt = right(rs("addDt"),11)
			memo = rs("memo")
			if memos <> "" then memos = memos & "<br>"
			memos  = memos & "[" & addDt & "] " & memo
			userNm = rs("userNm")

		Rs.movenext
		Loop 
	End If
	Call mkXMLNode("memoSeqs", memoSeqs, 1)
	Call mkXMLNode("memos", memos, 1)
	Call mkXMLNode("userNm", userNm, 1)
	Response.write "</Memo>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>